package fserv.control;

import java.io.File;
import java.net.InetAddress;

/**
 * Communication interface: Fileshare => ChatController
 * 
 * @author Arthur Bit-Monnot <abit@etud.insa-toulouse.fr>
 * @author Julien Marchand <jmarchan@etud.insa-toulouse.fr>
 */
public interface FileshareToCtrl {
    
    /**
     * Notifies the Controller that a local file share has started.
     * 
     * @param file the shared file
     */
    public void fileShareStarted(File file);
    
    /**
     * Notifies the Controller that a local file share has stopped.
     * 
     * @param file the shared file
     */
    public void fileShareStopped(File file);
    
    /**
     * Notifies the Controller that a file upload has started, i.e. a remote
     * peer is downloading a locally shared file.
     * 
     * @param file the shared file
     * @param addr the InetAddress of the remote peer
     */
    public void fileShareUploadStarted(File file, InetAddress addr);
    
    /**
     * Notifies the Controller that a file upload has finished, i.e. a remote
     * peer has finished downloading a locally shared file.
     * 
     * @param file the shared file
     * @param addr the InetAddress of the remote peer
     */
    public void fileShareUploadFinished(File file, InetAddress addr);
    
    /**
     * Notifies the Controller that a file upload has failed, i.e. a remote
     * peer couldn't complete the download of a locally shared file.
     * 
     * @param file the shared file
     * @param addr the InetAddress of the remote peer
     */
    public void fileShareUploadFailed(File file, InetAddress addr);
    
    /**
     * Notifies the Controller that a file download has started, i.e. the local
     * user is downloading a file shared by a remote peer.
     * 
     * @param file the shared file
     * @param addr the InetAddress of the remote peer
     */
    public void fileShareDownloadStarted(File file, InetAddress addr);
    
    /**
     * Notifies the Controller that a file download has finished, i.e. the local
     * user has finished downloading a file shared by a remote peer.
     * 
     * @param file the shared file
     * @param addr the InetAddress of the remote peer
     */
    public void fileShareDownloadFinished(File file, InetAddress addr);
    
    /**
     * Notifies the Controller that a file download has failed, i.e. the local
     * user couldn't complete the download of a file shared by a remote peer.
     * 
     * @param file the shared file
     * @param addr the InetAddress of the remote peer
     */
    public void fileShareDownloadFailed(File file, InetAddress addr);
    
}
